@extends('app')
@section('content')
<ul class="nav nav-tabs">
    <li><a href="{{ url('/admin/user')}}">业绩考核添加</a></li>
</ul>
<form id="userForm" method="post" action="">
    <div class="panel panel-default description2 mt20">
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">用户名：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                    {{getUserName($uid)}}
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">业绩月份：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <select name="dateid" class="form-control">
                    <option value="{{ $dateid-1 }}" >{{ $dateid-1 }}</option>
                    <option value="{{ $dateid }}" selected>{{ $dateid }}</option>
                    <option value="{{ $dateid+1 }}">{{ $dateid+1 }}</option>
                </select>
                <button type="button" class="btn btn-info" onclick="perfUrl();">
                    <i class="icon-ok bigger-110"></i>
                    确定
                </button>
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;"> 该月业绩目标：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <textarea type="text" class="form-control" name="goal"> @if(!empty($att)){{$att->goal}}@endif</textarea>
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;"> 该月业绩总分值：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <input type="number" class="form-control" name="score" placeholder="业绩总分值" value="@if(!empty($att)){{ $att->score }}@endif">
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;">该月业绩完成情况：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <textarea type="text" class="form-control" name="achievement"> @if(!empty($att)){{$att->achievement}}@endif</textarea>
            </div>
        </div>
        <div class="form-group clearfix">
            <label class="col-xs-12 col-sm-3 col-md-2 control-label" style="padding-left: 0;padding-right: 0;"> 完成度%：</label>
            <div class="col-sm-9 col-xs-12" style="padding-left: 0;padding-right: 0;">
                <input style="width:90%; display: inline-block;" type="number" class="form-control" name="percent" placeholder="完成度%" value="@if(!empty($att)){{ $att->percent }}@endif">%
            </div>
        </div>
        {!! csrf_field() !!}
        <input type="hidden" name="uid" value="@if(!empty($uid)){{ $uid }}@endif">
        <input type="hidden" name="blademode" value="{{$blademode}}">
        <input type="hidden" name="id" value="@if(!empty($att)){{ $att->id }}@endif">
        <div class="form-inline">
            <div class="form-group">
              <button type="button" class="btn btn-info" onclick="saveData('/admin/performance/perf-store','userForm')">
                    <i class="icon-ok bigger-110"></i>
                    Submit
              </button>  
            </div>
        </div>
    </div>
</form>
    <script>
        function perfUrl(){
            var dateid = $('select[name=dateid]').val();
            var uid = $('input[name=uid]').val();
            var perfurl = '/admin/performance/perf-edit?uid='+uid+'&dateid='+dateid;
            window.location.href=perfurl;
        }
    </script>
<script>
    $('.list-group-item').eq(1).addClass('active');
</script>
@endsection
